Make sure middleware layer sorting is stable

/to @bajtos @ritch 

The PR fixes the middleware layer sorting issue that has caused https://github.com/strongloop/strong-arc/issues/767. The culprit is https://code.google.com/p/v8/issues/detail?id=90.