x11_common: don't allocate more than needed for icon

icon_size is the number of array items of type long, not bytes. Change
the type of icon_size to int, because size_t makes you think of byte
quantities too quickly.

As an unrelated change, change the (char *) cast to (unsigned char *),
because it matches the common XChangeProperty idiom better.
path: add a common mp_is_url() function

Remove the duplicated code.
command: unescape URLs for ${filename} and ${media-title}

Undo URL percent encoding if the filename appears to be an URL. This
will fix display of the actual filename in some cases.

We don't put any effort into checking whether the URL is really percent
encoded, because we don't really know how the protocol handler is going
to interpret the URL. For stream_lavf, we probably can't know. Still,
from the perspective of this commit, it seems to make sense to assume
they are percent encoded.
mplayer: allow resuming from playlist

This includes the case of passing multiple files to command line
(internally this is the same as loading a playlist).

Resuming works by finding the first playlist entry that can be resumed.

Alternative implementations would be possible, such as hashing the
playlist contents. But this implementation is simpler, and doesn't have
the disadvantage that changes to the playlist (like appending entries)
will throw away the resume point.

This makes loading large playlists a bit slower, because it has to look
into ~/.mpv/watch_later/ for every entry. Loading a 15000 entries
playlist now increases from 150ms to 400ms. Considering you rarely load
playlists this big with mpv (because it's impractical considering the
terminal and non-GUI nature of the player), this is probably ok.
path: better check for mp_is_url()

The previous check just searched for a "://" substring. This was quite
bad, because "://" can be a valid part of a path. Later, I added
special handling for filenames starting with "." and "/", so that you
could reliably pass arbitrary filenames to mpv, no matter how messed
up they were.

Even though it doesn't really matter in practise anymore, this is still
crap, so add a more reliable check instead.