peerhandler: Use 'for' instead of 'forEach' to iterate with index

When using 'return' to continue iterating, 'i' was not properly
incremented, which would cause a media session to be configured with
a media description intended for another media session.