* Friendships change over time, no social network (Facebook included) could crack that.
* "The youth" don't want to be on the same social network as their parents.
* Timeline spam from games was going to kill the network.
* People were uber concerned about privacy and would flock to a more privacy-aware alternative, particularly with employers starting to check up on employees.
* Someone was bound to go and take away Facebook's golden goose - image hosting.
* Mobile monetization was going to be a massive problem for them.
I had other reasons, but I was young(er) and naive(r). They dealt with those threats - by introducing features, having critical mass, changing their partnerships, reassuring users, opening their wallet, and figuring out how to do mobile well respectively.
Yes, free (as in GNU) software is always a threat to people trying to profit from software, but it's no more serious to Facebook in the medium term than any of the above. People are lazy, there's a lot of inertia behind Facebook at this stage, and setting up your own social network-type stuff on your own server is (and always will be) seen as "too hard" for most people.
I highly doubt that they'll be unseated for quite a while (even under the glacially crushing weight of OSS) so long as they keep making the good calls that they've been making over the past few years.