It is only safe while under the care and guidance of your doctor.
They don't recommend you take anything other than paracetamol without advice so go to your GP.
I have pelvic problem and have been prescribed it so it isn't unsafe but needs to be monitored.
Don't stress about what you've taken so far just get to the gp or at least speak to the pharmacist next time.
As above it is safe but not the best option. Can you not be referred to physio for your back pain? I was referred and between their advice and exercises etc I am avoiding crutches so far.
Also codeine can worsen a headache so for a headache paracetamol is better. Other things they say to try for a headache is caffeine (obviously in safe amounts for pregnancy) and lots of water. Most headaches in pregnancy are due to lack of fluid and hormones.
Codeine also worsens constipation.
Good luck, feel better soon x