ftdi/write_serial_number.sh: Script robustness

Added set -e and using paths in the template filename for better
robustness.

Signed-off-by: Joakim Gebart <joakim.gebart@eistec.se>