You want to avoid locking the front wheel as doing so makes the bike stop steering. Small steering corrections are how you keep the bike upright, and locking the front wheel can make you fall down hard.
Best bet will be to shift your body rearward as much as possible to avoid pivoting over the bars and then squeeze both grips. The rear wheel almost always will lock on hard braking as it is unloaded. When I stop very hard my rear wheel typically leaves the ground.