How do deal with the following situations using Prim's algorithm?
First of all , MST of a connected graph is a subgraph with the following properties:
i. Spanning Tree: No cycles -> n-1 edges(easy to prove)
ii. If we sum up the weights, we get the lowest possible.

Prim's algorithm is a greedy algorithm, which means that we always choose the best choice in every step(greedy).


From i, you can see that you never get self loops (acyclic).
Yes, because it's the edge with the lowest weight not because it is the only edge in this moment from D to connect in E; there maybe exist another edge eg. C->E would have been the next choice had the weight between D->E is 5.
No, it does not get to a non-terminating loop, you never choose the same edge again. Think like, there is a set S with all the edges that have not been discarded, after you choose the edge e then S is changed to S-e. In your example the best choice is to choose E->F.