Learning Safe Neural Network Controllers with Barrier Certificates