Militants have rammed into a Pakistan police post in an explosive-filled car and begun firing, killing at least 12 officers.