France and Britain have agreed to deploy more police and invest in detection technology on the French coast to try to stop boats carrying illegal migrants from reaching British shores.