Probing the atmospheres of exoplanets and brown dwarfs with near-IR polarimetry