If you were gay (homosexual) you would have known about that way before the age of 30. You would not have fancied your girlfriend and have been turned on by her.
It is very common to go "limp" when changing positions because the momentum was interrupted.
If you have not had this problem before, it may be a good idea to get your hormone levels checked out. The doctor can do this by taking a blood test. Having a low testosterone level does not mean that you are "gay" either. But if your hormone levels are low, the doctor will be able to prescribe you with a testosterone gel to apply to the skin on your body.
You may have a prostate problem, so it would be worth getting that checked too.
Best wishes
Premature ejaculation means you are over excited and ejaculated, In no way it can be interpreted as a gay attitude of yours. You can try edging to prevent quick ejaculation. Google the word EDGING. Try it with your girl friend. In a short time you will be able to sustain erection for a longer time.You may also do deep abdominal breathing to stop premature ejaculation.First learn abdominal breathing.(Google it)
Hey! don't think too much that you are gay you will feel gay man comeon God has created you a man a gentle man be brave... take it light relax! and have a good sex with your girlfriend :-)