gsm0408: Avoid unaligned memory access in gsm48_generate_mid_from_tmsi

The &buf[3] is unlikely to be aligned properly. Use memcpy instead
of an assignment. Add a small testcase that verifies that I didn't
mess up the conversion.

Alignment trap: osmo-nitb (3293) PC=0x492b7094 Instr=0xe5803003 Address=0xbeb259db FSR 0x801
diff --git a/src/gsm/gsm48.c b/src/gsm/gsm48.c
index ea05d45..313d9a3 100644
--- a/src/gsm/gsm48.c
+++ b/src/gsm/gsm48.c
@@ -308,12 +308,12 @@
 
 int gsm48_generate_mid_from_tmsi(uint8_t *buf, uint32_t tmsi)
 {
-	uint32_t *tptr = (uint32_t *) &buf[3];
+	uint32_t tmsi_be = htonl(tmsi);
 
 	buf[0] = GSM48_IE_MOBILE_ID;
 	buf[1] = GSM48_TMSI_LEN;
 	buf[2] = 0xf0 | GSM_MI_TYPE_TMSI;
-	*tptr = htonl(tmsi);
+	memcpy(&buf[3], &tmsi_be, sizeof(tmsi_be));
 
 	return 7;
 }