Probing galaxy dark matter haloes in COSMOS with weak lensing flexion