Three-dimensional instability in open cavity flows